﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Jy123.BLL.Hire
{
    public class Hire
    {
        public Jy123.Model.Public_HireRecord GetLatestRecord(int moduleId)
        {
            string strWhere = string.Format("FModule = {0} ORDER BY StartTime DESC", moduleId.ToString());
            Public_HireRecord BLLRecord = new Public_HireRecord();
            List<Jy123.Model.Public_HireRecord> listRecord = BLLRecord.GetModelList(strWhere);
            if (listRecord.Count > 0)
            {
                return listRecord[0];
            }
            return null;
        }

        public Jy123.Model.Public_HireRecord GetLatestLiveRecord(int moduleId)
        {
            string strWhere = string.Format("FModule = {0} AND Status = 1 ORDER BY StartTime DESC", moduleId.ToString());
            Public_HireRecord BLLRecord = new Public_HireRecord();
            List<Jy123.Model.Public_HireRecord> listRecord = BLLRecord.GetModelList(strWhere);
            if (listRecord.Count > 0)
            {
                return listRecord[0];
            }
            return null;
        }
    }
}
